Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-sources: Add agent data model and endpoint definition for multi sources #41

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

tupyy
Copy link
Collaborator

@tupyy tupyy commented Oct 16, 2024

This commit adds the data model and store implementation for agent resource. The source model has been modified by adding a many2one relationship to the agent.

A new endpoint /api/v1/agents has been defined but not implemented.

There are no breaking changes in the current implementation.

Solves: ECOPROJECT-2271

Signed-off-by: Cosmin Tupangiu [email protected]

@@ -53,6 +53,42 @@ paths:
application/json:
schema:
$ref: '../openapi.yaml#/components/schemas/Error'
/api/v1/agents/{id}:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be /api/v1/agents/{id}/status?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it can be. I wrote it like this cause we don't have another put operation on the agent.
I'll change it

@tupyy tupyy force-pushed the agent-api branch 2 times, most recently from 0045487 to 6cb6fb0 Compare October 16, 2024 09:29
@tupyy tupyy force-pushed the agent-api branch 2 times, most recently from a3479c4 to c07847d Compare November 12, 2024 20:05
This commit adds the data model for agent resource. The source model has
been modified by adding a many2one relationship to the agent.

A new endpoint `/api/v1/agents` has been added but not implemented.

Signed-off-by: Cosmin Tupangiu <[email protected]>
type: object
properties:
id:
type: string
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nirarg Here we would like to have the version in the future.

@@ -21,6 +21,7 @@ type Source struct {
SshKey string
Inventory *JSONField[api.Inventory] `gorm:"type:jsonb"`
CredUrl *string
Agents []Agent `gorm:"constraint:OnDelete:SET NULL;"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is now the relation between agents statuses and source status?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good question. At this stage, the list of source statuses is the same with the agent's. Definitely, we should improve that.

@@ -21,6 +21,7 @@ type Source struct {
SshKey string
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We we want to move the sshkey out of here. Or will that be done in followup PRs?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

follow up

@machacekondra machacekondra merged commit 6ac0f8d into kubev2v:main Nov 13, 2024
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants